<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/bizappproject/purchase_requisition/Purchase_Requisition.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/bizappproject/purchase_requisition/Purchase_Requisition.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Purchase_Requisition",
        setup() {
            const table = ref({
                key: "id",
                footer: "Foots",
                cnName: "三地采购申请信息汇总",
                name: "purchase_requisition/Purchase_Requisition",
                newTabEdit: false,
                url: "/Purchase_Requisition/",
                sortName: "id"
            });
            const editFormFields = ref({"product_name":"","spec":"","request_qty":"","date_required":"","request_type":"","reason":"","month":"","factory":"","year":"","purchase_state":"","purchase_date":"","purchase_notes":"","last_update_on":""});
            const editFormOptions = ref([[{"title":"","field":"product_name","disabled":true},
                               {"title":"","field":"spec","disabled":true}],
                              [{"title":"","field":"request_qty","disabled":true,"type":"decimal"},
                               {"title":"","field":"date_required","disabled":true}],
                              [{"title":"1:月度计划，2：临时计划","field":"request_type","type":"number"},
                               {"title":"","field":"reason","disabled":true}],
                              [{"title":"1:北京空港，2：安泰爱科，3：安泰北方","field":"factory","type":"number"},
                               {"title":"","field":"month","disabled":true}],
                              [{"title":"","field":"year","disabled":true},
                               {"title":"","field":"purchase_state"}],
                              [{"title":"","field":"purchase_date"},
                               {"title":"","field":"purchase_notes"}],
                              [{"title":"","field":"last_update_on","disabled":true}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:"year",title:"year",type:"string",sort:true,width:150,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"month",title:"month",type:"string",sort:true,width:150,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"id",title:"id",type:"int",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"product_name",title:"product_name",type:"string",width:150,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"spec",title:"spec",type:"string",width:150,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"request_qty",title:"request_qty",type:"decimal",width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"date_required",title:"date_required",type:"datetime",sort:true,width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"request_type",title:"1:月度计划，2：临时计划",type:"int",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"reason",title:"reason",type:"string",width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"factory",title:"1:北京空港，2：安泰爱科，3：安泰北方",type:"int",sort:true,width:110,showOverflowTooltip:true,align:"left"},
                       {field:"purchase_state",title:"purchase_state",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"purchase_date",title:"purchase_date",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"purchase_notes",title:"purchase_notes",type:"string",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"last_update_on",title:"last_update_on",type:"datetime",width:110,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"mes_id",title:"mes_id",type:"int",width:120,showOverflowTooltip:true,align:"left"}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
